<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<title>权限管理</title>
<head th:replace="common/common_header" />
<link rel="stylesheet" type="text/css"
	th:href="@{~/thirdlib/jquery.ztree/zTreeStyle.css}" />
</head>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">
		<header th:replace="common/header :: header">Header</header>
		<aside th:replace="common/left :: left">left</aside>

		<div class="content-wrapper">
			<section class="content-header">
				<div class="container-fluid">
					<div class="row mb-2">
						<div class="col-sm-6">
							<h1>用户管理</h1>
						</div>
						<div class="col-sm-6">
							<ol class="breadcrumb float-sm-right">
								<li class="breadcrumb-item"><a href="#">Home</a></li>
								<li class="breadcrumb-item active">用户管理</li>
							</ol>
						</div>
					</div>
				</div>
			</section>

			<section class="content">
				<div class="row">

					<div class="col-md-2"
						style="margin-top: 55px; border: 1px solid gray; border-radius: 5px;">
						<ul id="roleTree" class="ztree"
							style="width: 100%; overflow: auto;"></ul>
					</div>
					<div class="col-md-2"
						style="margin-top: 55px; border: 1px solid gray; border-radius: 5px;">
						<ul id="resourceTree" class="ztree"
							style="width: 100%; overflow: auto;"></ul>
						<button type="button" class="btn btn-saveRoleResource"
							style="height: 30px; width: 50px;"
							onclick="saveRoleResourceInfo()">保存</button>
					</div>

					<div class="col-md-8" style="height: calc(100% - 110px)">
						<div id="toolbar_user">
							<button type="button" class="btn btn-primary"
								onclick="addUserRole();">新增角色用户</button>
							<button type="button" class="btn btn-danger"
								onclick="deleteUserRoles();">删除角色用户</button>
						</div>
						<table id="userTable" data-toggle="table"
							data-classes="table table-hover table-condensed"
							data-pagination="true" data-side-pagination="server"
							data-show-refresh="true" data-toolbar="#toolbar_user"
							data-id-field="refid" data-smart-display="false"
							data-click-to-select="true">
							<thead>
								<tr>
									<th data-field="statusUser" data-checkbox="true"></th>
									<th data-field="refid" data-visible="false"></th>
									<th data-field="userName">用户名</th>
									<th data-field="loginId">登录账户</th>
									<th data-field="userType" data-formatter="formatterUserType">用户类型</th>
									<th data-field="ApplyDatetime">创建时间</th>
									<th data-formatter="deleteUserOperate">操作</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</section>
		</div>
		<div class="list-group" id="treemenu"
			style="position: absolute; visibility: hidden; top: 0; padding: 2px;">
			<a class="list-group-item" id="tree_add" onclick="addTreeNode();">
				<i class="fa fa-plus-circle fa-lg"></i> <span class="m-left-xs">增加角色</span>
			</a> <a class="list-group-item" id="tree_remove"
				onclick="removeTreeNode();"> <i class="fa fa-trash fa-lg grey"></i>
				<span class="m-left-xs">删除角色</span>
			</a> <a class="list-group-item" id="tree_edit" onclick="editTreeNode();">
				<i class="fa fa-edit fa-lg grey"></i> <span class="m-left-xs">修改角色</span>
			</a>
		</div>

		<div class="modal fade" id="roleModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabelReport" aria-hidden="true">
			<div id="dialogId" class="modal-dialog"
				style="background-color: #f5f7fa; width: 1020px;"></div>
		</div>

		<div class="modal fade" id="userModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabelReport" aria-hidden="true">
			<div id="dialogId" class="modal-dialog"
				style="background-color: #f5f7fa; width: 1020px;"></div>
		</div>

		<footer th:replace="common/footer :: footer">footer</footer>

		<!-- Control Sidebar -->
		<div class="control-sidebar-bg"></div>
	</div>
	<div th:replace="common/common_foot :: foot"></div>
	<script th:src="@{~/thirdlib/jquery.ztree/jquery.ztree.all.js}"></script>
	<script th:src="@{~/js/auth/role.js}"></script>
</body>
</html>
